-- zonecrossroads.lua
------------------------------------------------------------------------------
-- Title: 'Crossroads' Level
-- Authors: Jeremy Wolff
-- Description: Spawns the level 'Crossroads' when the given object is clicked
------------------------------------------------------------------------------
KILL_SWITCH_ID = 126
GENERATE_BLOCKS_ID = 1205
kgp.scriptDoFile("SpleefGen.lua")
set_level(CROSSROADS)

-- TODO: trigger this via a menu
function kgp_touch(user, clickLoc, count, objects) 
  obj_pid = objects[1]
  if obj_pid == KILL_SWITCH_ID then
    destroy_level(LEVEL_NUMBER)
  elseif obj_pid == GENERATE_BLOCKS_ID then
    build_level(LEVEL_NUMBER)
  end
end
